/**
 * 206. 反转链表
 * https://leetcode.cn/problems/reverse-linked-list/description/
 */
class Solution2 {
    public ListNode reverseList(ListNode head) {
        if(head == null || head.next == null) return head;
        ListNode newHead = reverseList(head.next);
        head.next.next = head;
        head.next = null;
        return newHead;
    }
}